<!--
 * @Author: zhangxiangsheng 1026583651@qq.com
 * @Date: 2024-06-17 15:04:34
 * @LastEditors: zhangxiangsheng 1026583651@qq.com
 * @LastEditTime: 2024-06-26 10:42:23
 * @FilePath: \appGly\components\formz\components\datetimepicker.vue
 * @Description: 
 * 
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved. 
-->
<template>
  <view class="">
    <u-form-item
      :label="item.label"
      borderBottom
      ref="item1"
      :prop="item.value"
    >
      <view @click="show = true" style="flex: 1">
        {{ inputValue }}
      </view>
    </u-form-item>

    <u-datetime-picker
      :show="show"
      v-model="pickerValue"
      mode="datetime"
      @confirm="() => (show = false)"
      @cancel="() => (show = false)"
    ></u-datetime-picker>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        show: false,
      };
    },
    computed: {
      list() {
        return [];
      },
      pickerValue: {
        get() {
          let v = this.value;
          return this.$z.timefn.getdateTime(v);
        },
        set(e) {
          this.$emit(
            "input",
            this.$z.timefn.gettime(0, new Date(e), "yyyy-mm-dd hh:MM:ss")
          );
        },
      },
      inputValue() {
        return this.value || this.$z.$t("请选择");
      },
    },
    props: {
      item: {
        typeof: Object,
        default: () => {
          return {};
        },
      },
      data: {
        typeof: Object,
        default: () => {
          return {};
        },
      },
      value: {
        typeof: [String, Number, Boolean, Array, Object],
        default: () => {
          return "";
        },
      },
    },

    methods: {},
  };
</script>

<style></style>
